<%@include file="/pages/include/tag_include.jsp"%>
<%@include file="/pages/include/base_context.jsp"%>
<script>
    jQuery(document).ready(function($){
        $('.action-publish').click(function(){
            $('#the-form').attr('action','<s:url value="/conference/publish.do"/>')
            $('#the-form').submit();
        });
    });

</script>

<div class="container">
    <%@include file="/pages/include/message_display_include.jsp"%>

    <form id="the-form" class="form-horizontal" method="POST" action='<s:url value="/conference/save.do"/>?id=<s:property value="%{form.conference.id}"/>'>
        <input type="hidden" name="form.conference.id" value="<s:property value="%{form.conference.id}"/>" />
        <div class="control-group">
            <label class="control-label" for="inputName">Name</label>
            <div class="controls">
                <input type="text" name="form.conference.name" value='<s:property value="%{form.conference.name}"/>' id="inputUsername" placeholder="Name">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inputDescription">Description</label>
            <div class="controls">
                <input type="text" name="form.conference.description" value='<s:property value="%{form.conference.description}"/>' id="inputUsername" placeholder="Description">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inputStartDate">Start Date</label>
            <div class="controls">
                <input type="text" name="form.conference.startDate" value='<s:property value="%{form.conference.startDate}"/>' id="inputStartDate" placeholder="Start Date">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inputEndDate">End Date</label>
            <div class="controls">
                <input type="text" name="form.conference.endDate" value='<s:property value="%{form.conference.endDate}"/>' id="inputEndDate" placeholder="End Date">
            </div>
        </div>

        <a href="<s:url value="/conference/list.do"/>" class="btn btn-danger" ><s:text name="cancel"/></a>

        <input type="submit" value="<s:text name="save"/>" class="btn btn-success">

        <s:if test="%{form.conference.pkSet}">
            <a href="javascript:void(0)" class="btn btn-success action-publish" ><s:text name="publish"/></a>
        </s:if>
    </form>

    <script>
        $('#inputStartDate').datepicker({format: 'mm-dd-yyyy'})
        .on('changeDate', function(ev){
            $('#inputStartDate').datepicker('hide');
        });
        $('#inputEndDate').datepicker({format: 'mm-dd-yyyy'})
        .on('changeDate', function(ev){
            $('#inputEndDate').datepicker('hide');
        });
    </script>

</div>
